export const TYPE_PDF = ['pdf']
export const TYPE_OFFICE = ['.doc', '.docx', '.xls', '.xlsx', '.ppt', '.pptx']
export const TYPE_IMAGE = ['.png', '.jpg', '.jpeg', 'webp']
export const TYPE_VIDEO = ['.mp4', '.avi']

export const ACCEPT = [
  TYPE_PDF.join(','),
  TYPE_OFFICE.join(','),
  TYPE_IMAGE.join(',')
].join(',')

export default {
  table: 'ie_attachment',
  columns: [
    {
      key: 'id'
    },
    {
      title: '文件名',
      key: 'filename'
    },
    {
      title: '文件后缀',
      key: 'ext',
      width: 100
    },
    {
      title: '文件预览',
      key: 'filepath',
      type: 'file'
    },
    {
      title: '创建时间',
      key: 'create_at',
      type: 'date',
      sorter: true
    }
  ],
  queryOptions: {
    ext: {
      type: 'select',
      options: [
        { label: '.pdf', value: '.pdf' },
        { label: '.png', value: '.png' },
        { label: '.jpg', value: '.jpg' },
        { label: '.jpeg', value: '.jpeg' },
        { label: '.webp', value: '.webp' }
      ],
      multiple: true
    },
    create_at: {
      type: 'daterange',
      format: 'yyyy-MM-dd'
    }
  }
}
